package com.stylefeng.guns.modular.customer.warpper;

import com.stylefeng.guns.core.base.warpper.BaseControllerWarpper;
import com.stylefeng.guns.core.common.constant.factory.ConstantFactory;
import com.stylefeng.guns.core.util.SpringContextHolder;
import com.stylefeng.guns.core.util.ToolUtil;
import com.stylefeng.guns.modular.customer.dao.AreaDao;
import com.stylefeng.guns.modular.system.dao.AreaMapper;

import java.util.Map;

public class AreaWrapper extends BaseControllerWarpper {

    public AreaWrapper (Object o) {
       super(o);
    }
    public void warpTheMap(Map<String, Object> map) {
        AreaDao areaDao = SpringContextHolder.getBean(AreaDao.class);
        Integer pid =  (Integer) map.get("pid");
        if(ToolUtil.isEmpty(pid)||pid.equals(0)){

            map.put("pName","--");
        }else{
            map.put("pName", areaDao.selectNameById(pid));
        }


    }
}
